test("Settings",function(){
	
	expect( 28 );
	
	// some local variables to track settings
	var $box1, $box2, html1 = 0, html2 = 0,
	// element refs to instantiate
	$div1 = jQuery('<div></div>'), 
	$div2 = jQuery('<div></div>'),
	$div3 = jQuery('<div></div>');
	
	// create some custom settings to test
	$.blackbox("settings1",{
		html: function( $box ){
			$box1 = $box;
			html1 += 1;
			return "Hello World.";
			},
		once: true,
		empty: false,
		//isolate: false, 
		opacity: .19, 
		background: '#F00', 
		height: 200, 
		width: 300, 
		top: 400, 
		left: 500, 
		showEvent: "open1", 
		hideEvent: "close1", 
		classroot: "ux-blackbox-settings1",
		classes: { bg:"classroot-override1" }
		});
	
	// create more custom settings to test
	$.blackbox("settings2",{
		html: function( $box ){
			$box2 = $box;
			html2 += 1;
			return "Goodnight Moon.";
			},
		once: false,
		empty: true,
		isolate: false, 
		opacity: .57, 
		background: '#0F0', 
		height: 500, 
		width: 400, 
		top: 300, 
		left: 200, 
		showEvent: "open2", 
		hideEvent: "close2", 
		classroot: "ux-blackbox-settings2",
		classes: { box:"classroot-override2" }
		});
	
	// create isolation settings to test
	$.blackbox("settings3",{ 
		isolate: true,
		showEvent: "open3"
		});
	
	// create the test instances
		
	$div1.blackbox("settings1");
	$div2.blackbox("settings2");
	$div3.blackbox("settings3");
	// bind some events hooks to all the instances
	$([ $div1[0], $div2[0], $div3[0] ])
		.bind("show:blackbox",function(){
			$.data( this, "bbx-is-open", true );  
			})
		.bind("hide:blackbox",function(){
			$.data( this, "bbx-is-open", false );
			});
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// show number one
	$div1.trigger("open1");
	// make sure it is open
	ok( $div1.data("bbx-is-open"), "showEvent setting" );
	// check html settings
	equals( $box1.text(), "Hello World.", "html fn return value" );
	// check class settings
	ok( $box1.is(".ux-blackbox-settings1-box"), "classroot setting" );
	ok( $box1.prev().is(".classroot-override1"), "classroot override setting" );
	// check size settings			
	equals( $box1.height(), 200, "height setting" );
	equals( $box1.width(), 300, "width setting" );
	// check position settings
	equals( $box1.offset().top, 400, "top setting" );
	equals( $box1.offset().left, 500, "left setting" );
	// check appearance settings
	equals( $box1.prev().css("opacity"), .19, "opacity setting" );
	equals( $box1.prev().css("backgroundColor").replace(/\s/g,""), "rgb(255,0,0)", "background setting" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// hide number one
	$box1.prev().trigger("close1");
	// check that it closed correctly
	ok( !$div1.data("bbx-is-open"), "closeEvent setting" );
	// check that the box was not emptied out
	equals( $box1.text(), "Hello World.", "empty setting" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// show number one again
	$div1.trigger("open1");
	// make sure the box was not refilled
	equals( html1, 1, "once setting" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// show number two
	$div2.trigger("open2");
	// make sure it is open
	ok( $div1.data("bbx-is-open") && $div2.data("bbx-is-open"), "isolate setting" );
	// check the html settings
	equals( $box2.text(), "Goodnight Moon.", "html fn return value" );
	// check class settings
	ok( $box2.prev().is(".ux-blackbox-settings2-bg"), "classroot setting" );
	ok( $box2.is(".classroot-override2"), "classroot override setting" );
	// check size settings
	equals( $box2.height(), 500, "height setting" );
	equals( $box2.width(), 400, "width setting" );
	// check position settings
	equals( $box2.offset().top, 300, "top setting" );
	equals( $box2.offset().left, 200, "left setting" );
	// check appearance settings
	equals( $box2.prev().css("opacity"), .57, "opacity setting" );
	equals( $box2.prev().css("backgroundColor").replace(/\s/g,""), "rgb(0,255,0)", "background setting" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// hide number two
	$box2.prev().trigger("close2");
	// make sure it closed correctly
	ok( !$div2.data("bbx-is-open"), "closeEvent setting" );
	// make sure the box was emptied out
	equals( $box2.text(), "", "empty setting" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// show number two again
	$div2.trigger("open2");
	// make sure the box was refilled
	equals( html2, 2, "once setting" );
	equals( $box2.text(), "Goodnight Moon.", "html fn 2nd return value" );
	
	//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx	
	// show number three (hides one and two)
	$div3.trigger("open3");
	ok( !$div1.data("bbx-is-open") && !$div2.data("bbx-is-open") && $div3.data("bbx-is-open"), "isolate setting" );
	
	// cleanup any instances
	$div1.ux("blackbox.destroy").unbind().removeData();
	$div2.ux("blackbox.destroy").unbind().removeData();
	$div3.ux("blackbox.destroy").unbind().removeData();
	});